import React from 'react';
import { Link } from 'react-router-dom';
import { Map, Languages, Download, Settings } from 'lucide-react';

const HomePage: React.FC = () => {
  const features = [
    {
      name: '智能地图',
      description: '探索周边景点，规划最佳路线',
      icon: Map,
      href: '/map',
      color: 'bg-blue-500'
    },
    {
      name: '实时翻译',
      description: '支持多种语言的文字和语音翻译',
      icon: Languages,
      href: '/translation',
      color: 'bg-green-500'
    },
    {
      name: '离线内容',
      description: '下载离线地图和翻译包',
      icon: Download,
      href: '/offline',
      color: 'bg-purple-500'
    },
    {
      name: '个性设置',
      description: '自定义您的旅行偏好',
      icon: Settings,
      href: '/settings',
      color: 'bg-orange-500'
    }
  ];

  return (
    <div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100">
      <div className="page-container py-6 sm:py-8 lg:py-12">
        {/* 欢迎区域 - 响应式居中 */}
        <div className="text-center mb-8 sm:mb-12 lg:mb-16 content-centered">
          <h1 className="text-responsive font-bold text-gray-900 mb-3 sm:mb-4 px-2 text-balance">
            欢迎使用多语言旅行助手
          </h1>
          <p className="text-base sm:text-lg lg:text-xl text-gray-600 max-w-3xl mx-auto px-4 leading-relaxed text-balance">
            您的智能旅行伙伴，提供实时翻译、智能导航、离线地图等功能，
            让您的旅行更加轻松愉快。
          </p>
        </div>

        {/* 功能卡片 - 响应式网格布局 */}
        <div className="content-centered mb-8 sm:mb-12 lg:mb-16">
          <div className="feature-grid grid gap-6 lg:gap-8">
            {features.map((feature) => {
              const Icon = feature.icon;
              return (
                <Link
                  key={feature.name}
                  to={feature.href}
                  className="bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 lg:p-8 group transform hover:-translate-y-2 hover:scale-105"
                >
                  <div className={`${feature.color} w-14 h-14 lg:w-16 lg:h-16 rounded-xl flex items-center justify-center mb-4 lg:mb-6 group-hover:scale-110 transition-transform duration-300 shadow-lg`}>
                    <Icon className="h-7 w-7 lg:h-8 lg:w-8 text-white" />
                  </div>
                  <h3 className="text-xl lg:text-2xl font-bold text-gray-900 mb-3 lg:mb-4">
                    {feature.name}
                  </h3>
                  <p className="text-base lg:text-lg text-gray-600 leading-relaxed">
                    {feature.description}
                  </p>
                </Link>
              );
            })}
          </div>
        </div>

        {/* 快速开始 - 桌面端优化布局 */}
        <div className="text-center max-w-4xl mx-auto">
          <h2 className="text-2xl lg:text-3xl font-bold text-gray-900 mb-8 lg:mb-12">
            快速开始您的旅行
          </h2>
          <div className="flex flex-col sm:flex-row gap-4 lg:gap-6 justify-center">
            <Link
              to="/map"
              className="bg-blue-600 text-white px-8 lg:px-12 py-4 lg:py-5 rounded-xl font-semibold text-lg lg:text-xl hover:bg-blue-700 hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1"
            >
              🗺️ 探索地图
            </Link>
            <Link
              to="/translation"
              className="bg-white text-blue-600 border-2 border-blue-600 px-8 lg:px-12 py-4 lg:py-5 rounded-xl font-semibold text-lg lg:text-xl hover:bg-blue-50 hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1"
            >
              🌐 开始翻译
            </Link>
          </div>
          
          {/* 添加特色介绍 */}
          <div className="mt-16 lg:mt-20">
            <div className="grid grid-cols-1 md:grid-cols-3 gap-8 lg:gap-12">
              <div className="text-center">
                <div className="w-16 h-16 lg:w-20 lg:h-20 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4 lg:mb-6">
                  <span className="text-2xl lg:text-3xl">🌍</span>
                </div>
                <h3 className="text-lg lg:text-xl font-semibold text-gray-900 mb-2 lg:mb-3">全球覆盖</h3>
                <p className="text-gray-600 text-base lg:text-lg">支持全球200+个国家和地区的地图和翻译服务</p>
              </div>
              <div className="text-center">
                <div className="w-16 h-16 lg:w-20 lg:h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4 lg:mb-6">
                  <span className="text-2xl lg:text-3xl">📱</span>
                </div>
                <h3 className="text-lg lg:text-xl font-semibold text-gray-900 mb-2 lg:mb-3">离线可用</h3>
                <p className="text-gray-600 text-base lg:text-lg">下载离线地图和翻译包，无网络也能正常使用</p>
              </div>
              <div className="text-center">
                <div className="w-16 h-16 lg:w-20 lg:h-20 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4 lg:mb-6">
                  <span className="text-2xl lg:text-3xl">🎯</span>
                </div>
                <h3 className="text-lg lg:text-xl font-semibold text-gray-900 mb-2 lg:mb-3">智能推荐</h3>
                <p className="text-gray-600 text-base lg:text-lg">基于您的位置和偏好，智能推荐最佳旅行路线</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
};

export default HomePage;